package com.bdqn.t382.practice2;


public class Printer {
    private Cartridge cartridge; // 墨盒
    private Paper paper; // 纸张

    public Printer(Cartridge cartridge, Paper paper) {
        this.cartridge = cartridge;
        this.paper = paper;
    }

    public Cartridge getCartridge() {
        return cartridge;
    }

    public void setCartridge(Cartridge cartridge) {
        this.cartridge = cartridge;
    }

    public Paper getPaper() {
        return paper;
    }

    public void setPaper(Paper paper) {
        this.paper = paper;
    }


    public void print(String text) {
        // System.out.println("使用 " + paper.getSize() + "纸打印 " + cartridge.getColor() + " 墨盒:");
        System.out.println("使用" + cartridge.getColor() + "墨盒在" + paper.getSize() + "纸上打印！");
        System.out.println(text);
    }
}
